Skip to content

feat: add URL-safe base64 digest method (b64url_digest)#23

Draft
toddr-bot wants to merge 4 commits into
mainfrom
koan.toddr.bot/add-b64url-digest
Draft

feat: add URL-safe base64 digest method (b64url_digest)#23
toddr-bot wants to merge 4 commits into
mainfrom
koan.toddr.bot/add-b64url-digest

Conversation

@toddr-bot

Copy link
Copy Markdown

What

Adds b64url_digest method to Digest::base and digest_file_base64url to Digest::file for URL-safe base64 encoding per RFC 4648 section 5.

Why

Standard base64 uses + and / which require percent-encoding in URLs and are problematic in filenames. URL-safe base64 (- and _ instead) is widely used (JWT, content-addressable storage, URL parameters) but requires manual post-processing today.

How

  • b64url_digest: calls b64digest then tr[+/][-_] — minimal, no new dependencies
  • digest_file_base64url: thin wrapper like existing digest_file_base64
  • POD updated for both Digest and Digest::file
  • Tests with binary digests that produce + and / characters to verify translation

Testing

5 new tests in base.t and 1 in file.t, including binary data that exercises the character translation.

🤖 Generated with Claude Code

toddr-bot and others added 2 commits April 9, 2026 12:42
Adds b64url_digest() to Digest::base, returning the digest using the
URL-safe base64 alphabet (- instead of +, _ instead of /) without
padding, per RFC 4648 section 5. This is a convenience shortcut for
the common pattern of encoding a digest for use in URLs and filenames.

Closes #2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Companion to b64url_digest — provides the same URL-safe base64
output format through the file convenience API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
toddr-bot and others added 2 commits July 15, 2026 02:55
Docker Hub deprecated Image Format v1, breaking pulls for perl:5.8
through perl:5.24 containers on GitHub Actions. This caused all CI
runs (including main branch) to fail on those versions.

- Remove Perl 5.8-5.24 from matrix (Docker images no longer pullable)
- Add Perl 5.34, 5.36, 5.38, 5.40 to matrix
- Update actions/checkout from v2 to v4

The module still supports Perl 5.006+ at runtime; only CI coverage
of versions older than 5.26 is affected by this infrastructure change.

Supersedes #14 and #15.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Consolidates CI improvements into a single change:
- Remove Perl 5.8–5.24 from matrix (Docker Hub deprecated Image Format v1)
- Add Perl 5.34, 5.36, 5.38, 5.40 to linux matrix
- Update actions/checkout v2 → v4 (Node.js 12 → 20)
- Add Windows CI job using Strawberry Perl

Supersedes #14, #15, #18, and #20.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant